#ifndef _DEFSSCANNER_H
#define _DEFSSCANNER_H

#include <stdio.h>

FILE* inputStreamScanner;
FILE* outputStreamScanner;

#define norw        12          /* number of reserved words */
#define imax        32767       /* maximum integer value */
#define cmax        11          /* maximum number of chars for idents */
#define nmax        5           /* maximum number of digits for numbers */
#define nestmax     5           /* maximum depth of block nesting */
#define strmax      256         /* maximum length of strings */
#define tempmax     50          /* maximum length that will be tokenized */

#define MAX_NAME_TABLE_SIZE     10000
#define TOKEN_TYPE_COUNT        33

extern char *tokenLookup[];

typedef enum {
    nulsym = 1, identsym, numbersym, plussym, minussym,
    multsym,  slashsym, oddsym, eqsym, neqsym, lessym, leqsym,
    gtrsym, geqsym, lparensym, rparensym, commasym, semicolonsym,
    periodsym, becomessym, beginsym, endsym, ifsym, thensym,
    whilesym, dosym, callsym, constsym, intsym, procsym, writesym,
    lbracketsym, rbracketsym
} token_type;


/* list of special symbols */
int ssym[256];

/*typedef enum {
    beginlistsym = 1, endlistsym, throughsym, oneormoresym, zeroormoresym, orsym, beginsetsym, endsetsym
} regex_type;

char* regexLookup[] = {"", "[", "]", "-", "+", "*", "|", "(", ")"};*/

typedef enum {
    valid = 1, array, notletter, numover, identover, invalidsym, notarray
} error_codes;

int TOKEN_LENGTH;

char tokens[MAX_NAME_TABLE_SIZE][tempmax];

int tokenType[MAX_NAME_TABLE_SIZE];

/* structure of the symbol table record */
typedef struct
{
	int kind; 		    // const = 1, var = 2, proc = 3.
	char name[cmax];	// name up to 11 chars
	int val; 		    // number (ASCII value)
	int level; 		    // L  level
	int adr; 		    // M  address
} namerecord_t;

namerecord_t* table[MAX_NAME_TABLE_SIZE];

int curLevel;

#endif
